#ifndef INVADER_CONTROLLER_H
#define INVADER_CONTROLLER_H

#include "sprites.h"
#include <vector>
#include "collisions.h"

namespace game
{
	//This class controls the invaders.
	//This is used so that when the invaders drop down, it is because
	//at least one of them has reached the end.
	class InvaderController
	{
	private:
		//moving bounds
		float maxLeft;
		float maxRight;
		float blockWSize;
		float blockHSize;
		float top;

		//to control invader speed
		int delay;
		int curDelay;

		//number of invaders
		int row;
		int collumn;

		//Invader Orientation
		float rotationModifier;

		bool movingRight;
		bool hasReseted;

		//keep a default for when we start a new round
		vector<vector<sprites::Sprite*>> invaders;
		vector<vector<sprites::Sprite*>> invadersDefault;

		//used to pass new bullets to the collision engine
		vector<sprites::Sprite*> bullets;

	public: 
		//constructor
		InvaderController(int row, int collumn);

		//start a new round
		void reset();

		//Invader orientation
		//This flag will be used to signal for the aliens to switch which way they are facing.
		bool orientationFlag;

		//draw
		void draw();

		//used to transfer pointers to bullets and invaders
		//for the collision checks.
		vector<sprites::Sprite*> getInvaders();
		vector<sprites::Sprite*> getBullets();
		bool InvaderController::hasReset();
	};
}
#endif